package javaseof10day.day6.am;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;

public class FileReaderAndFileWriterDemo {

	public static void main(String[] args) throws IOException {
	
		//读取文件并写入到另一个文件里
		 System.out.println("start");
		 
	        Reader in = new FileReader("src/readme.txt");
	        Writer out = new FileWriter("src/readme2.txt");
	 
	        char [] arr = new char[100];
	        int n;
	 
	        while((n = in.read(arr)) > 0){
	            out.write(arr,0,n);
	        }
	 
	        in.close();
	        out.close();
	 
	        System.out.println("end");
	 
	    }


		
	

}
